package com.ly.hotel.common;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.BaseAdapter;

public abstract class MyAdapter<T> extends BaseAdapter {

	protected Context context;
	protected List<T> list;
	protected LayoutInflater inflater;
	public MyAdapter(Context c,List<T> l) {
		this.list = l;
		this.context = c;
		inflater = LayoutInflater.from(context) ;
	}

	@Override
	public int getCount() {
		if(list != null){
			return list.size();
		}else{
			return 0;
		}
	}

	@Override
	public T getItem(int position) {
		if(list != null){
			return list.get(position);
		}else{
			return null;
		}
	}

	@Override
	public long getItemId(int position) {
		return position;
	}
}
